#include <opencv2/highgui.hpp>
#include <iostream>
#include <string>
#include "gray_transform.hpp"
#include "spatial_filter.hpp"
using namespace std;




int main(int argc, char const *argv[])
 {
 	string fileName = "../../images/fractured_spine.tif";
 	string fileName_2 = "../../images/digital_Xray.tif";
	string fileName_3 = "../../images/DFT_no_log.tif";
	string fileName_4 = "../../images/histogram1.tif";
	string fileName_5 = "../../images/histogram2.tif";
	string fileName_6 = "../../images/histogram3.tif";
	string fileName_7 = "../../images/test_pattern_blurring_orig.tif";
	string fileName_8 = "../../images/hubble-original.tif";
	string fileName_9 = "../../images/ckt_board.tif";
	string fileName_10 = "../../images/blurry_moon.tif";
	string fileName_11 = "../../images/dipxe_text.tif";
	string fileName_12 = "../../images/contact_lens_original.tif";
	string fileName_13 = "../../images/Lenna.png";

 	cv::Mat aerial_image = cv::imread(fileName, 0);
 	auto digitalXrayImage = cv::imread(fileName_2, 0);
 	auto dftImage = cv::imread(fileName_3, 0);
 	auto histImage1 = cv::imread(fileName_4, 0);
 	auto histImage2 = cv::imread(fileName_5, 0);
 	auto histImage3 = cv::imread(fileName_6, 0);
 	auto blurImage = cv::imread(fileName_7, 0);
 	auto hubbleImage = cv::imread(fileName_8, 0);
 	auto boardImage = cv::imread(fileName_9, 0);
 	auto moonImage = cv::imread(fileName_10, 0);
 	auto dipxeImage = cv::imread(fileName_11, 0);
 	auto contactImage = cv::imread(fileName_12, 0);
 	auto lennaImage = cv::imread(fileName_13, 0);

 	cout<<"channels:"<<aerial_image.channels()<<endl;
	cout << "type:" << aerial_image.type() << endl;
 	cv::imshow("aerial_image", aerial_image);

 	auto gammaTransformImage = graytransform::gammaTransform(aerial_image, 0.6);

 	cv::imshow("gammaTransform", gammaTransformImage);

 	auto reverseImage = graytransform::imageReverse(digitalXrayImage);

 	cv::imshow("reverseImage", reverseImage);

 	//auto logarithmTransformImage = graytransform::logarithmTransform(dftImage, 1);
 	auto logarithmTransformImage = graytransform::gammaTransform(dftImage, 0.6);

 	cv::imshow("originImage", dftImage);
 	cv::imshow("logarithmTransformImage", logarithmTransformImage);

 	
	auto histResult = graytransform::equalizeHistogram(histImage3);
	cv::imshow("histOriginImage", histImage3);
	cv::imshow("histgramResult", histResult);
	// graytransform::drawHistogram(histImage1, "histImage1");
	// graytransform::drawHistogram(histImage2, "histImage2");
	// graytransform::drawHistogram(histImage3, "histImage3");

	//spatialfilter::boxFilter(boardImage, 15);

	// spatialfilter::mediaFilter(boardImage, 3);

	spatialfilter::laprasFilter(moonImage, 1);

	spatialfilter::unsharpMask(dipxeImage, 10);

	spatialfilter::gradientSharp(lennaImage, 2);


 	cv::waitKey(0);
 	return 0;
 } 